home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / GSAVE2.ZIP / PCXLOAD2.ASM < prev    next >
Assembly Source File  |  1995-12-15  |  2KB  |  124 lines

  1. ;Simple PCX loader. No Header Checking cause I hardly have any idea what
  2. ;values it holds!
  3.  
  4. .model small
  5. .stack 100h
  6. .data
  7.  
  8. picture dw ?
  9. file    db 'SCREENGS.PCX',0
  10.  
  11. .code
  12.         mov     ax,@data
  13.         mov     ds,ax
  14.  
  15.         mov     ax,4a00h
  16.         mov     bx,1000
  17.         int     21h
  18.  
  19.         mov     ax,0013h
  20.         int     10h
  21.         push    0a000h
  22.         pop     es
  23.  
  24.         mov     ax,4800h
  25.         mov     bx,1000h
  26.         int     21h
  27.         mov     picture,ax
  28.  
  29.         mov     ax,3d00h
  30.         lea     dx,file
  31.         int     21h
  32.         jnc     file_exists
  33.         jmp     error
  34. file_exists:
  35.         mov     bx,ax
  36.  
  37.         mov     ax,4202h
  38.         xor     cx,cx
  39.         xor     dx,dx
  40.         int     21h
  41.  
  42.         sub     ax,768
  43.  
  44.         mov     cx,dx
  45.         mov     dx,ax
  46.         mov     ax,4200h
  47.         int     21h
  48.  
  49.  
  50.         mov     ax,3f00h
  51.         mov     cx,768        
  52.         xor     dx,dx
  53.         push    ds picture
  54.         pop     ds
  55.         int     21h
  56.  
  57.         mov     ax,4200h
  58.         xor     cx,cx
  59.         mov     dx,128
  60.         int     21h
  61.  
  62.         mov     dx,3c8h
  63.         xor     al,al
  64.         out     dx,al
  65.         inc     dx
  66.         mov     cx,768
  67.         xor     si,si
  68. load_colors:
  69.         lodsb
  70.         shr     al,2
  71.         out     dx,al
  72.         loop    load_colors
  73.         pop     ds
  74.  
  75.         mov     ax,3f00h
  76.         mov     cx,320*200
  77.         xor     dx,dx
  78.         push    ds picture
  79.         pop     ds
  80.         int     21h
  81.         
  82.         xor     si,si
  83.         xor     di,di
  84. pcx_load:
  85.         lodsb
  86.       
  87.         cmp     al,192
  88.         jb      single_byte
  89.  
  90.         and     al,63
  91.         mov     cl,al
  92.         
  93.         lodsb
  94.         jmp     draw_color
  95. single_byte:
  96.         mov     cl,1
  97. draw_color:
  98.         xor     ch,ch
  99.         rep     stosb
  100.         cmp     di,320*200
  101.         jb      pcx_load
  102.         pop     ds
  103.  
  104.         mov     ax,3e00h
  105.         int     21h
  106.  
  107.         xor     ah,ah
  108.         int     16h
  109.  
  110. error:
  111.  
  112.         push    es
  113.         mov     ax,picture
  114.         mov     es,ax
  115.         mov     ax,4900h
  116.         int     21h
  117.         pop     es
  118.  
  119.         mov     ax,0003h
  120.         int     10h
  121.         mov     ax,4c00h
  122.         int     21h
  123. end
  124.